<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="__ADMIN__/css/font.css">
<link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
<script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
<script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
<link rel="stylesheet" href="/static/admin/css/font.css">
<link rel="stylesheet" href="/static/admin/css/font-awesome.min.css">
<style>
.layui-form-item .layui-form-label{
    width: 120px;
}
.layui-form-item .layui-textarea{
    width: 190px;
}
#phone-one-div {display: none}
.layui-form-select {z-index: 99999 !important}
.layui-upload-file{display:block !important}

</style>
</head>

<body>
<div class="x-body">
<form class="layui-form" action="">

 
<table class="layui-table" lay-size="sm">
  <colgroup>
    <col width="200">
    <col>
  </colgroup>
  <tbody>
    <tr>
      <td>活动名称</td>
      <td>{$data.title}</td>
    </tr>
    <tr>
      <td>本直播间客户收益</td>
      <td>{$data.client_final_income}元</td>
    </tr>
    {if $data.otherSettle}
    <tr >
      <td>一同结算收益</td>
      <td>{volist name="data.otherSettle" id="v"}{$v.client_final_income}+{/volist}<b>{$data.client_final_income}</b></td>
    </tr>
    <tr >
      <td>一同结算收益(总)</td>
      <td><b>{$data.sumOtherSettle}</b>元</td>
    </tr>
    {/if}
    <tr>
      <td>转账日期 </td>
      <td>
          <input type="text" name="settle_date" id="settle_date" value="{$data.settle_date?:date('Y-m-d')}" autocomplete="off" class="layui-input">
          
      </td>
    </tr>
    <tr>
      <td>转账方式 </td>
      <td>
      <input type="radio" name="settle_type" value="公转" title="公转" {$data.settle_type=='公转'?'checked':''}>
      <input type="radio" name="settle_type" value="私转" title="私转" {$data.settle_type=='私转'?'checked':''}>
      <input type="radio" name="settle_type" value="无需转" title="无需转" {$data.settle_type=='无需转'?'checked':''}>
      </td>
    </tr>
    <tr>
      <td>转账账户 </td>
      <td>
      <input type="radio" name="settle_account" value="雪鲸" title="雪鲸" {$data.settle_account=='雪鲸'?'checked':''}>
      <input type="radio" name="settle_account" value="可赞" title="可赞" {$data.settle_account=='可赞'?'checked':''}>
      <input type="radio" name="settle_account" value="东创" title="东创" {$data.settle_account=='东创'?'checked':''}>
      <input type="radio" name="settle_account" value="星权" title="星权" {$data.settle_account=='星权'?'checked':''}>
      <br>
      <input type="radio" name="settle_account" value="徐涛" title="徐涛" {$data.settle_account=='徐涛'?'checked':''}>
      <input type="radio" name="settle_account" value="徐操" title="徐操" {$data.settle_account=='徐操'?'checked':''}>
      </td>
    </tr>

    <tr>
      <td>结算备注</td>
      <td><textarea name="settle_remark" id="settle_remark" placeholder="" class="layui-input" >{$data.settle_remark}</textarea></td>
    </tr>
    <tr>
        <td>上传转账截图</td>
        <td>
            {if !$data.settle_image }{/if}
            
            <a href="{$data.settle_image}" target="_blank"><img id="img" src="{$data.settle_image}"  style="margin-top: 5px;display: block; width:90%;max-width:90%;"></a>
            <input type="hidden" name="settle_image" id="settle_image"  value="{$data.settle_image}" />
            
            <button type="button" style="width: 140px;" class="layui-btn layui-btn-sm layui-btn-normal" id="uploads">上传图片</button>
        </td>
    </tr>
    <tr>
      <td colspan="2" align="center">    
        <button type="button" class="layui-btn" lay-filter="add" lay-submit="">确定</button>
      </td>
    </tr>
  </tbody>
</table>
<input type="hidden" name="id" value="{$data.id}">



</form>
</div>
<script>

    
    
layui.use(['form','layer','laydate','upload','layarea','rate'], function(){
    var $ = layui.jquery;
    var form = layui.form
    ,layer = layui.layer
    ,laydate = layui.laydate
    ,upload = layui.upload
    ,layarea = layui.layarea
    ,rate = layui.rate;
  laydate.render({
    elem: '#settle_date'
  });
    var uploadInst = upload.render({
          elem: '#uploads'
          , url: '{:url("DataTable/upload")}'
          , before: function (obj) {
            //预读本地文件示例，不支持ie8
            obj.preview(function (index, file, result){
                //如果有图片再点击上传就撤销原来的图片
                var img=$("#img").attr("src");
                var imgurl=$("#settle_image").val();
                $('#img').attr('src', result); //图片链接(base64)
            });
          }
          , done: function (res) {
              //如果上传失败
              if (res.code == 0) {
                  return layer.msg(res.err);
              }
              //上传成功
              if(res.code == 1) {
                  $('#img').parent('a').attr('href','/uploads/jiesuan/'+res.savename);
                  $('#img').attr('src','/uploads/jiesuan/'+res.savename);
                  $('#settle_image').attr('value','/uploads/jiesuan/'+res.savename);
              }
          }
    });
      
      
    form.on('submit(add)', function(data){

        $.post('{:url("Performance/saveField")}',$('form').serializeArray(),function(data){
            //data = JSON.parse(data);
            if(data.code == 1){
                layer.alert(data.msg, {icon: data.icon},function(){
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                });    
            }
        },'json')
        return false;
    });

});
    </script>
  </body>

</html>